﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chap11 {
    public class Point {
        public int X { get; set; }
        public int Y { get; set; }

        public Point(int xPos, int yPos) {
            X = xPos;
            Y = yPos;
        }


        public static Point operator +(Point p1, Point p2) {
            Point result = new Point(p1.X + p2.X, p1.Y + p2.Y);
            return result;
        }

        public static Point operator -(Point p1, Point p2) {
            Point result = new Point(p1.X - p2.X, p1.Y - p2.Y);
            return result;
        }

        public override string ToString() {
            return string.Format("[{0}, {1}]", X, Y);
        }
    }
}